%-------------------------------------------------------------------------
%
% Latex-Beamer theme for non-commercial/private use
%
% Author: Xian Qiu
% Date: May 1, 2015
% Version: 1.1beta
%
% ------------------------------------------------------------------------

% block
\renewenvironment{block}[2][]{
	\vspace{6pt}
	\usebeamerfont{blocktitle}
	\begin{tikzpicture}[inner sep = 0pt]
	    \node[soft blue, anchor = south west] at (0,0) {#2 #1};
	    \draw[themecolor,line width = 1pt] (0,-0.1) -- (\textwidth,-0.1);
	\end{tikzpicture}
	\usebeamerfont{blockcontent}
}{
    \hfill\\
    \vspace{-6pt}
    \normalsize
    \begin{tikzpicture}[inner sep = 0pt]
        \draw[black!30,line width = 1pt] (0,-0) -- (\textwidth,0);
    \end{tikzpicture}
    \hfill\\[6pt]
}

%plain block
\newcommand{\pblock}[2]{\footnotesize \textcolor{soft blue}{#1} \normalsize #2 \hfill}

%-------------------------------------------------------------------------
% math environment
%-------------------------------------------------------------------------
\renewenvironment{theorem}[1][]{\begin{block}[#1]{Theorem}}{\end{block}}
\renewenvironment{lemma}[1][]{\begin{block}[#1]{Lemma}}{\end{block}}
\renewenvironment{corollary}[1][]{\begin{block}[#1]{Corollary}}{\end{block}}
\newenvironment{proposition}[1][]{\begin{block}[#1]{Proposition}}{\end{block}}
\newenvironment{claim}[1][]{\begin{block}[#1]{Claim}}{\end{block}}
\newenvironment{conjecture}[1][]{\begin{block}[#1]{Conjecture}}{\end{block}}

\renewenvironment{proof}{
	\begin{tikzpicture}[inner sep = 0pt]
	\node[soft blue, anchor = south west] at (0,0) {\usebeamerfont{blocktitle}Proof};
	\draw[black!30,line width = 0.5pt] (0,-0.1) -- (\textwidth,-0.1);
	\end{tikzpicture}
	\hfill\\
	\footnotesize
}{
\hfill\\[-6pt]
\normalsize
\begin{tikzpicture}[inner sep = 0pt]
\draw[black!30,line width = 0.5pt] (0,-0) -- (\textwidth,0);
\end{tikzpicture}
\hfill\\[12pt]
}

%-------------------------------------------------------------------------
% ttssticker
% 4 args: pos =<(x,y)>, color =<.>, content =<.>
%-------------------------------------------------------------------------

\newcommand{\sticker}[3]{
	\begin{textblock}{300}#1
		\colorbox{#2}{
			\begin{tikzpicture}[inner sep=0]
			\node[align=justify] at (0,0) {\scriptsize #3};
			\end{tikzpicture}
		}
	\end{textblock}
}

% e.g. \redsticker{(3,2)}{text}

\newcommand{\yellowsticker}[2]{\sticker{#1}{yellow!20}{#2}}
\newcommand{\bluesticker}[2]{\sticker{#1}{blue!50}{\textcolor{white}{#2}}}
\newcommand{\greensticker}[2]{\sticker{#1}{green!20}{#2}}
\newcommand{\redsticker}[2]{\sticker{#1}{red!20}{#2}}
\newcommand{\orangesticker}[2]{\sticker{#1}{orange!20}{#2}}
\newcommand{\blacksticker}[2]{\sticker{#1}{black!20}{#2}}
	